package com.corona.game;

import com.corona.Game;
import com.corona.game.util.SpriteProxy;

/* compiled from: Battle.java */
/* loaded from: pokewilds.jar:com/pkmngen/game/PokemonIntroAnim.class */
public class PokemonIntroAnim extends Action {
    SpriteProxy originalSprite;
    public Action.Layer layer = Action.Layer.gui_140;
    int currFrame = 0;
    boolean firstStep = true;

    public PokemonIntroAnim(Action nextAction) {
        super(new Object[0]);
        this.nextAction = nextAction;
    }

    @Override // com.corona.game.Action
    public String getCamera() {
        return "gui";
    }

    @Override // com.corona.game.Action
    public Action.Layer getLayer() {
        return this.layer;
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (this.firstStep) {
            this.originalSprite = game.battle.oppPokemon.sprite;
            this.firstStep = false;
        }
        if (this.currFrame >= game.battle.oppPokemon.introAnim.size()) {
            game.battle.oppPokemon.sprite = this.originalSprite;
            game.actionStack.remove(this);
            game.insertAction(this.nextAction);
            return;
        }
        game.battle.oppPokemon.sprite = game.battle.oppPokemon.introAnim.get(this.currFrame);
        game.battle.oppPokemon.sprite.setPosition(this.originalSprite.getX(), this.originalSprite.getY());
        this.currFrame++;
    }
}
